package com.lianbang.staff.model

import cn.ubest.mvvmcore.base.BaseModel
import cn.ubest.mvvmcore.bean.ListWrapper
import cn.ubest.mvvmcore.bean.ResultWrapper
import cn.ubest.mvvmcore.bean.Wrapper
import com.lianbang.staff.bean.OrderListBean
import com.lianbang.staff.bean.ShopOrderDetailBean
import com.lianbang.staff.http.api.OrderApi
import retrofit2.http.Field

/**
 * Created by maoqi on 2021/1/14.
 */
class OrderModel : BaseModel() {
    private val c = OrderApi::class.java

    suspend fun getOrderList(
        @Field("status") status: Int,
        @Field("page") page: Int,
        @Field("limit") limit: Int,
        @Field("order") order: String
    ): ListWrapper<OrderListBean> {
        return createService(c).getOrderList(status, page, limit, order)
    }

    //门店订单详情
    suspend fun getOrderDetail(
        id: Int
    ): ResultWrapper<ShopOrderDetailBean> {
        return createService(c).getShopOrderDetail(id)
    }

    //门店订单确认
    suspend fun confirmShopOrder(
        id: Int,
        status: Int,
        pay_price: Float
    ): Wrapper {
        return createService(c).confirmShopOrder(id, status, pay_price)
    }
}